﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tanmia.Basis;
using System.Configuration;
using System.Reflection;
using Tanmia.Domain;
using Tanmia.Core;

namespace Tanmia.Factory
{
    class Program
    {
        static void Main(string[] args)
        {
            string appDbRep = "Tanmia.NHibernate";
            bool generateApplicationDatabase = true;

            DatabaseConfiguration dbConfig = new DatabaseConfiguration("NHibernate.config", Assembly.Load(appDbRep));
            dbConfig.BuildSessionFactory();
            if (generateApplicationDatabase)
                dbConfig.GenerateDatabase();


            //ItemCategoryDomain ICD = new ItemCategoryDomain();
            //ItemCategory IC = new ItemCategory();
            //IC.CreateDate = new DateTime(2012, 6, 19);
            //IC.Name = "عبسي";
            //IC.Note = "fgdgfdgfdgfdg";
            //ICD.Save(IC);

            //ColorDomain CD = new ColorDomain();
            //Color C = new Color();
            //C.Name = "Haytham";
            //C.CreateDate = new DateTime(2012, 2, 14);
            //C.Note = "dfdsjhfiuoeghfijdsgfidshbvghdfsgjrs";
            //C.Category = IC;

            //CD.Save(C);

            //Dictionary<string, object> f = new Dictionary<string, object>();

            //CD.Search(f);

            //AccountDomain AD = new AccountDomain();
            //Account A = new Account();

            //try
            //{
            //    AD.Save(A);

            //}
            //catch (Exception ex)
            //{
            //    Console.WriteLine(ex.Message);
            //    Console.WriteLine(ex.InnerException.Message);
            //}
        }
    }
}
